# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=smbbf
pkgver=0.9.1
pkgrel=4
pkgdesc='SMB password bruteforcer.'
url="http://packetstormsecurity.com/files/25381/smbbf-0.9.1.tar.gz.html"
groups=('blackarch' 'blackarch-cracker')
license=('GPL')
depends=('openssl')
arch=('x86_64' 'aarch64')
options=('!makeflags')
source=("https://dl.packetstormsecurity.net/Crackers/$pkgname-$pkgver.tar.gz")
sha512sums=('cbd2ab98cf8e6a131a3767a031a8df62e7315e48302d233b17ebb8821ae4faa0aab5a78f5b97981822be653d74efd74eac44c601a9af74deb1e0a5e7fffe1099')

prepare() {
  cd $pkgname

  sed -i '/SMBBF_INCLUDE =/cSMBBF_INCLUDE = -Iinclude -I\/usr\/include\/openssl -DCLK_TCK=CLOCKS_PER_SEC' Makefile
  sed -i '/LIBDES=/cLIBDES = -lcrypto' Makefile
  sed -i "/^CC =/cCC = gcc $CFLAGS" Makefile
}

build() {
  cd $pkgname

  make
}

package() {
  cd $pkgname

  install -Dm 755 nbdecode smbbf smbdumpusers smbgetserverinfo "$pkgdir/usr/bin"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README *.txt
}

